import {useCallback, useState} from "react";
import {configureChains, createConfig, useAccount, useConnect, useDisconnect} from "wagmi";
import {InjectedConnector} from "wagmi/connectors/injected";
import {connect} from "@wagmi/core";
import {mainnet, sepolia} from "wagmi/chains";
import {alchemyProvider} from "wagmi/providers/alchemy";
import {useModel} from "@@/exports";
import NFTconfig from "@/config/NFTconfig";

export default function user() {
    const c = NFTconfig.network === "sepolia" ? sepolia : mainnet;
    const {chains, publicClient} = configureChains(
        [c], [
            // infuraProvider({apiKey: '3dfa925017ac41138500cc95d5941236'})
            alchemyProvider({apiKey: NFTconfig.api_key})
            // , publicProvider()
            // publicProvider()
        ]);

    const inj = new InjectedConnector({chains})
    return {publicClient, inj,};
}